import java.util.Scanner;

public class XueTet {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        Xuesheng java78 = new Xuesheng();
        java78.name = "牛x的java78";
        java78.laoshi = "Old Liu";
        int choice = 0;
        while (true) {
            System.out.println("1:加新生,2:查看信息，3：按名字查找，4：按照范围查找，5：按位置找，6:修改用户名，8：退出");
            choice = in.nextInt();
            if (choice == 1) {
                System.out.print("请输入新生的姓名：");
                String sname = in.next();
                java78.add(sname);
            } else if (choice == 2) {
                java78.show();
            } else if (choice == 3) {
                System.out.print("找谁：");
                String name = in.next();
                boolean exists = java78.xingmixuanze(name);
                if (exists) {
                    System.out.println(name + "在这个班");
                } else {
                    System.out.println(name + "不在这个班");
                }

            } else if (choice == 4) {
                System.out.print("请输入起点：");
                int start = in.nextInt();
                System.out.print("请输入终点：");
                int end = in.nextInt();
                System.out.print("找谁：");
                String name = in.next();
                boolean exists = java78.xuanze(start, end, name);//start,end,
                if (exists) {
                    System.out.println(name + "在这个班");
                } else {
                    System.out.println(name + "不在这个班");
                }

            } else if (choice == 5) {
                System.out.print("请输入位置：");
                int index = in.nextInt();
                System.out.println(java78.find(index));
            } else if (choice == 6) {
                System.out.print("输入客户姓名：");
                String name = in.next();
                boolean exists = java78.newName(name);
                if (exists) {
                    System.out.println("输入新名字");
                    String getName = in.next();
                    java78.getName(getName);
                } else {
                    System.out.println(name + "不在这个班");
                }

            } else if (choice == 8) {
                break;
            }
        }
    }
}
